#include <BustaModelFoodPiece.h>
Public Member Functions | |
BustaModelFoodPiece () | |
Constructor. | |
BustaModelFoodPiece (FoodType t, FoodState s) | |
Constructor. | |
BustaModelFoodPiece (int seed) | |
Constructor. | |
~BustaModelFoodPiece () | |
Destructor. | |
FoodType | getType () |
FoodPiece type. | |
void | setType (FoodType t) |
Sets FoodPiece type. | |
FoodState | getState () |
Freshness state. | |
void | setState (FoodState s) |
Sets freshness state. | |
bool | getImmobile () |
Gets immobility. | |
void | setImmobile (bool i) |
Sets immobility. | |
int | updateState () |
Updates state of FoodPiece. | |
int | freshenState () |
Updates state of FoodPiece. | |
int | spoilState () |
Updates state of FoodPiece. |
Model representing food piece, includes type, freshness state, timer
|
Constructor. Initializes variables |
|
Constructor. Initializes variables, sets type of food piece to t, state equal to s |
|
Constructor. If seed value != 0 then its is a pseudo-random FoodPiece constructor, else it will always construct the same FoodPiece() as long as seed != 0 |
|
Destructor. Destructor |
|
Updates state of FoodPiece. Updates the current state of the foodpiece based upon the current time. Returns 1 if switched states, 0 if didn't switch states, and -1 if foodPiece has rotted away |
|
Gets immobility. Returns boolean, saying whether the foodpiece can be swapped around the board or not |
|
Freshness state. Returns the current FoodPiece freshness state |
|
FoodPiece type. Gets the type of FoodPiece |
|
Sets immobility. Sets whether the foodpiece can be swapped around the board |
|
Sets freshness state. Sets the current FoodPiece freshness state |
|
Sets FoodPiece type. Sets the type of FoodPiece |
|
Updates state of FoodPiece. Updates the current state of the foodpiece based upon the current time. Returns 1 if switched states, 0 if didn't switch states, and -1 if foodPiece has rotted away |
|
Updates state of FoodPiece. Updates the current state of the foodpiece based upon the current time. Returns 1 if switched states, 0 if didn't switch states, and -1 if foodPiece has rotted away |